import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("preSalary")
class PreSalary extends BaseService {
  //售前工资配置列表
  presalewagelist({ size, ...args }) {
    let params = {
      ...args,
      pagesize: size
    };
    return this.$get("/listConfigure", { params }).then(res => {
      return {
        list: res.data,
        pagination: {
          ...params,
          size,
          total: res.total
        }
      };
    });
  }

  // 工资考核类型配置
  getStaffsalarytype(params) {
    return this.$get("/staffsalarytype", { params });
  }

  // 工资配置 => 改（查看明细）
  getConfigureDetails(params) {
    return this.$get("/configureInfo", { params });
  }

  // 工资配置=> 删
  delConfigure(params) {
    return this.$get("/delConfigure", { params });
  }

  // 工资配置=> 增
  addConfigure(params) {
    return this.$post("/addConfigure", params);
  }

  // 工资配置=> 改
  editConfigure(params) {
    return this.$post("/editConfigure", params);
  }

  // 售前工资列表
  getStaffsalarylist({ size, dept_ids, ...args }) {
    let params = {
      ...args,
      dept_id: dept_ids.join(),
      pagesize: size
    };
    return this.$get("/staffsalarylist", { params }).then(res => {
      return {
        list: res.data,
        pagination: {
          ...params,
          size,
          total: res.total
        }
      };
    });
  }

  // 售前职称级别列表
  getStaffsalaryassess(params) {
    return this.$get("/staffsalaryassess", { params });
  }

  // 售前绩效等级列表
  getStaffsalarybonus(params) {
    return this.$get("/staffsalarybonus", { params });
  }

  // 工资详情
  getStaffsalaryinfo(params) {
    return this.$get("/staffsalaryinfo", { params });
  }

  // 工资详情 => 汇总
  getStaffsalarydetaillist(params) {
    return this.$get("/staffsalarydetaillist", { params });
  }
}
export default PreSalary
